package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {
    //查询用户是否存在
    @Select("select * from user where phone=#{phone}")
    User findByPhone(String phone);
    //添加用户
    @Insert("insert into user(phone,status) values (#{phone},#{status})")
    Integer save(User user);
    //根据id查询用户信息
    @Select("select * from user where id=#{userId}")
    User selectById(Long userId);
}
